#!/bin/bash
echo 'start threshold'
PRG=$(readlink -f "$0")
PRGDIR=$(dirname "$PRG")
echo "PRGDIR $PRGDIR"
export CATALINA_BASE="$PRGDIR"/".."
mkdir -p "$CATALINA_BASE"/"logs"  "$CATALINA_BASE"/"temp"
echo "catalina base $CATALINA_BASE "
export JAVA_OPTS="$JAVA_OPTS ${APM_DAS_MEM} -Duser.dir="$PRGDIR"/.. -Dlogback.configurationFile=conf/logback.xml -Dfile.encoding="UTF-8" -Des.config.path=../es/config/ -Dapm.config.file=../conf/configure.properties -Xdebug -Xrunjdwp:transport=dt_socket,address=8004,server=y,suspend=n"
echo "JAVA_OPTS $JAVA_OPTS"
#exec "$PRGDIR"/"../../tomcat/bin/startup.sh"
cd "$PRGDIR"/"../../tomcat/bin/" && ./catalina.sh run 